-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade all packages using pur #4318
Conversation
requirements/deploy.txt
Outdated
django-mailgun==0.2.2 | ||
psycopg2==2.7.5 | ||
gunicorn==19.8.1 | ||
pysolr==3.7.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we never upgraded the deploy.txt
file. So, we should be careful with them.
requirements/testing.txt
Outdated
@@ -4,13 +4,13 @@ django-dynamic-fixture==2.0.0 | |||
|
|||
# 3.6.1 and >3.2.5 is incompatible | |||
# with pytest-describe 0.11.0 | |||
pytest==3.2.5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If test passes, remove this docstring. Otherwise, do not upgrade pytest
.
requirements/testing.txt
Outdated
apipkg==1.4 | ||
execnet==1.5.0 | ||
Mercurial==4.4.2 | ||
Mercurial==4.6.1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is terrible :/
Mercurial 4.3 and newer require Python 2.7. Mercurial versions up to 4.2 support Python versions 2.6 to 2.7, provided they include the following standard library components:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm confused how we're even installing hg
in our test suite if 3.x isn't supported. It seems this shouldn't work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we weren't hitting any of the Py 3.x problems but it wasn't supported. Although, it was possible to be installed and used:
Mercurial is actively being ported to Python 3. As of Mercurial 4.3, some commands work on Python 3. However, Python 3 is not yet a supported platform.
(from the bottom of the page I linked)
requirements/pip.txt
Outdated
|
||
# djangorestframework 3.7.x drops support for django 1.9.x | ||
djangorestframework==3.6.4 | ||
|
||
# Filtering for the REST API | ||
django-filter==1.1.0 | ||
django-filter==2.0.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We may need to check the migration guide to 2.0
https://django-filter.readthedocs.io/en/master/guide/migration.html#migrating-to-2-0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't use this for much so it should be fairly easy to test whether this works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't believe we can upgrade this one. Firstly, django-filter==2.0.0
requires Django 1.11 which we haven't upgraded to yet. Once we do that upgrade though, this migration should be fairly straight-forward. It looks like they changed the name of filter_fields
=> filterset_fields
. We use that in the API
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made a mistake when pushing my changes and I lost part of my work. There should be a note here saying what you just mentioned.
I'm sorry about that. I will re-add it.
d66c2aa
to
dfb609f
Compare
68d3ae8
to
ed3c02a
Compare
for reqs in `ls requirements`; do pur --skip django-tastypie,django,docker,elasticsearch,pyelasticsearch,commonmark,stripe,djangorestframework,mkdocs,django-allauth,django-filter,mercurial --requirement requirements/$reqs; done
ed3c02a
to
0045f06
Compare
8c6eb6b
to
3b1305a
Compare
Some block needed to be re-idented to fulfill this check. Basically, if you have a "if something: return another" the "else" clause is not needed since it will be the common case for the flow to continue if the condition is not met.
This PR is ready for review after some cleanup and fixes. |
readthedocs/wsgi.py
Outdated
@@ -8,7 +8,7 @@ | |||
# This application object is used by any WSGI server configured to use this | |||
# file. This includes Django's development server, if the WSGI_APPLICATION | |||
# setting points here. | |||
from django.core.wsgi import get_wsgi_application # pylint: disable=wrong-import-position | |||
from django.core.wsgi import get_wsgi_application # pylint: disable=wrong-import-position # noqa |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can leave only the # noqa
comment, right?
@@ -47,6 +51,9 @@ dnspython==1.15.0 | |||
|
|||
# VCS | |||
httplib2==0.11.3 | |||
|
|||
# GitPython 2.1.11 makes TestGitBackend.test_git_tags to fail because | |||
# of an UnicodeError |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe mention that we can update when we drop py2 support
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm starting to feel that this package is too unstable to rely all our building process on it. We just updated a bugfix version and it breaks our flow.
In the requirements, it says that it supports 2.7 or newer: https://gitpython.readthedocs.io/en/stable/intro.html#requirements
This is the commit that we think that introduced the issue: gitpython-developers/GitPython@7f08b77
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More examples:
- Crash with unicode path gitpython-developers/GitPython#761
- Error while listing submodules gitpython-developers/GitPython#279
- Unicode characters in branch name gitpython-developers/GitPython#774 (the last comment of this one tells us that Unicode may never be well supported :( )
I suppose that we should start thinking about another solution, unfortunately.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests in master
and 2.1.11
fail. Also in 2.1.10... 😥
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Regarding dropping py27 support, this will be our v3.0 -- it might make sense to time 3.0 for all of our deprecations in jan 2019. i opened #4594 to discuss more
This is ready for re-review and merge in my opinion. Besides upgrading the packages, since some linting packages were updated, I fixed some new lint issues that appeared here (thanks to @stsewd!) I'd like to merge this soon to avoid merge conflicts. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! This is another that we'll want to simmer a little. We'll want to be careful with some of this releasing to prod, and probably warrants some QA.
@@ -8,7 +8,7 @@ | |||
# This application object is used by any WSGI server configured to use this | |||
# file. This includes Django's development server, if the WSGI_APPLICATION | |||
# setting points here. | |||
from django.core.wsgi import get_wsgi_application # pylint: disable=wrong-import-position | |||
from django.core.wsgi import get_wsgi_application # noqa |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do generally prefer explicit disables, though I know that prospector was the one making this easier. For example, prospetor knows that pylint and flake8 (or whatever) throw an error on the same line, but pylint is ignoring -- it will therefore ignore the flake8 error as well. I don't think our pre-commit pass has anything comparable unfortunately.
#noqa
becomes a generic exception handler of sorts, where who knows what else we're ignoring when we use #noqa
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if this is possible. worth making an issue on common?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also like being explicit here. I didn't find how to avoid the checking that was failing, though. It was something related to the import not at the top of the file and it wasn't pylint (I think it was flake --don't remember). That's why I just added # noqa
.
As usual, upgrade all python packages from all requirements.
Just to know where we are regarding package versions and consider upgrade them if all test and manual QA pass.